home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d939.lha / Upcat / PrintLong.upcat < prev    next >
Text File  |  1993-12-20  |  2KB  |  70 lines

  1. /*-----------------------------------------------------------------------*/
  2. /* Example ARexx macro PrintLong for Upcat.                              */
  3. /*                                                                       */
  4. /* This macro prints the files of the catalog in long format.            */
  5. /* The current Display of Upcat must be 'Files - xxxx sorted'.           */
  6. /*                                                                       */
  7. /* You may adapt this macro or use parts of it for your own needs, but   */
  8. /* this macro must be distributed unchanged.                             */
  9. /*                                                                       */
  10. /* Author : Frans Zuydwijk                                               */
  11. /* Date   : 24 September 1993                                            */
  12. /*-----------------------------------------------------------------------*/
  13.  
  14. Trace Off
  15.  
  16. Options Results    /* Get information returned in Result */
  17.  
  18. "FirstSortFile"
  19.  
  20. If RC ~= 0
  21. Then Do
  22.      Select
  23.         When RC =  5 Then Message = 'No files to print'
  24.         When RC = 11 Then Message = 'Display is not Files - xxxx sorted'
  25.         Otherwise         Message = 'Error' RC 'from FirstSortFile'
  26.      End
  27.      "Requester" "Continue" Message
  28.      Exit
  29.      End 
  30.  
  31. If Open('Printer', 'PRT:') = 0
  32. Then Do
  33.      "Requester" "Continue" "Cannot open Printer"
  34.      Exit
  35.      End
  36.  
  37. If WriteCh('Printer', '1B'X || 'c') ~= 2   /* Reset */
  38. Then Do
  39.      "Requester" "Continue" "Error writing to Printer"
  40.      Close('Printer')
  41.      Exit 
  42.      End
  43.  
  44. Call WriteCh('Printer', '1B'X || '[4w')    /* Condensed fine on */
  45.  
  46. Do While RC = 0
  47.    Parse Var Result Level '/' Type '/' Name '/' Size '/' Date '/' , 
  48.                     Time '/' Protect '/' Categories '/' Comment
  49.  
  50.    Line = Left(Name,30) Date Time Right(Size,8) Protect Comment
  51.  
  52.    If Length(Line) > 132
  53.    Then Line = Left(Line, 132)  
  54.  
  55.    If WriteLn('Printer', Line) ~= Length(Line) + 1
  56.    Then Do
  57.         "Requester" "Continue" "Error writing to Printer"
  58.         Close('Printer')
  59.         Exit 
  60.         End
  61.  
  62.    "NextSortFile"
  63. End
  64.  
  65. Call WriteCh('Printer', '1B'X || '[3w')    /* Condensed fine off */
  66.  
  67. Close('Printer')
  68.  
  69. Exit
  70.